--
-- LOVE2D ANIMATION
--

--
-- This file will be loaded through love.filesystem.load
-- This file describes the different states and frames of the animation
--

--[[
	Each sprite sheet contains one or multiple states
	Each states is represented as a line in the image file
	The following object describes the different states
	Switching between different states can be done through code
	members ->
		imageSrc : path to the image (png, tga, bmp or jpg)
		defaultState : the first state
		states : a table containing each state
	(State)
	Each state contains the following members ->
		frameCount : the number of frames in the state
		offsetX : starting from the left, the position (in px) of the first frame of the state (aka on the line)
		offsetY : starting from the top, the position of the line (px)
		framwW : the width of each frame in the state
		frameH : the height of each frame in the state
		nextState : the state which will follow after the last frame is reached
		switchDelay : the time between each frame (seconds as floating point)
]]

-- the return statement is mandatory
return {
	imageSrc = "art/dwarf.png",
	defaultState = "inactiveright",
	states = {
		inactiveright = { -- the name of the state is arbitrary
			frameCount = 5,
			offsetX = 0,
			offsetY = 0,
			frameW = 38,
			frameH = 32,
			nextState = "inactiveright", -- we loop the running state
			switchDelay = 0.1
		},
		-- 2nd line
		walkright = {
			frameCount = 8,
			offsetX = 0,
			offsetY = 32,
			frameW = 38,
			frameH = 32, -- the frame height can change between states
			nextState = "walkright", -- after the jump is finished, we switch back to running
			switchDelay = 0.1
		},
		-- 3rd line
		jump_attackright = {
			frameCount = 7,
			offsetX = 0,
			offsetY = 64, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveright",
			switchDelay = 0.1
		},
		-- 4rd line
		attackright = {
			frameCount = 6,
			offsetX = 0,
			offsetY = 96, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveright",
			switchDelay = 0.1
		},
		-- 5a linio
		strangeright = {
			frameCount = 2,
			offsetX = 0,
			offsetY = 128, 
			frameW = 38,
			frameH = 32,
			nextState = "strangeright",
			switchDelay = 0.1
		},
		-- 6a linio
		jumpright = {
			frameCount = 5,
			offsetX = 0,
			offsetY = 160, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveright",
			switchDelay = 0.1
		},
		-- 7a linio
		hurtright = {
			frameCount = 4,
			offsetX = 0,
			offsetY = 192, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveright",
			switchDelay = 0.1
		},
		-- 8a linio
		ripright = {
			frameCount = 7,
			offsetX = 0,
			offsetY = 224, 
			frameW = 38,
			frameH = 32,
			switchDelay = 0.1
		},
		-- 1st line
		inactiveleft = { -- the name of the state is arbitrary
			frameCount = 5,
			offsetX = 0,
			offsetY = 256,
			frameW = 38,
			frameH = 32,
			nextState = "inactiveright", -- we loop the running state
			switchDelay = 0.1
		},
		-- 2nd line
		walkleft = {
			frameCount = 8,
			offsetX = 0,
			offsetY = 288,
			frameW = 38,
			frameH = 32, -- the frame height can change between states
			nextState = "walkleft", -- after the jump is finished, we switch back to running
			switchDelay = 0.1
		},
		-- 3rd line
		jump_attackleft = {
			frameCount = 7,
			offsetX = 0,
			offsetY = 320, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveleft",
			switchDelay = 0.1
		},
		-- 4rd line
		attackleft = {
			frameCount = 6,
			offsetX = 0,
			offsetY = 352, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveleft",
			switchDelay = 0.1
		},
		-- 5a linio
		strangeleft = {
			frameCount = 2,
			offsetX = 0,
			offsetY = 384, 
			frameW = 38,
			frameH = 32,
			nextState = "strangeleft",
			switchDelay = 0.1
		},
		-- 6a linio
		jumpleft = {
			frameCount = 5,
			offsetX = 0,
			offsetY = 416, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveleft",
			switchDelay = 0.1
		},
		-- 7a linio
		hurtleft = {
			frameCount = 4,
			offsetX = 0,
			offsetY = 448, 
			frameW = 38,
			frameH = 32,
			nextState = "inactiveleft",
			switchDelay = 0.1
		},
		-- 8a linio
		ripleft = {
			frameCount = 7,
			offsetX = 0,
			offsetY = 480, 
			frameW = 38,
			frameH = 32,
			switchDelay = 0.1
		}
	}
}
